$(function () {
    let bigImgBox = $('.big_imgBox');
    let firstS = $('.first_s');
    let secondS = $('.second_s');
    $.ajax({
        url: "http://localhost:3000/album/newest",
        success: function (res) {
            let albums = res.albums;
            console.log(albums);
            firstS.html('');
            secondS.html('');
            albums.forEach((el, index) => {
                if (index >= 10) return
                if (index < 5) {
                    firstS.append(`
                <li>
                    <div class="u-cover u-cover-alb1">
                        <img class="j-img"
                            data-src="${el.picUrl}"
                            src="${el.picUrl}">
                        <a title="${el.name}" href="#" class="msk"></a>
                        <a href="javascript:;" class="icon-play f-alpha f-fr" title="播放"
                            data-res-type="19" data-res-id="132874562" data-res-action="play"></a>
                    </div>
                    <p class="f-thide">
                        <a title="${el.name}" href="#" class="s-fc0 tit">${el.name}</a>
                    </p>
                    <p class="tit f-thide" title="${el.artists[0].name}">
                        <a class="s-fc3" href="/artist?id=12236125">${el.artists[0].name}</a>
                    </p>
                </li>
            `)
                } else {
                    secondS.append(`
                        <li>
                        <div class="u-cover u-cover-alb1">
                        <img class="j-img"
                        data-src="${el.picUrl}"
                        src="${el.picUrl}">
                        <a title="${el.name}" href="/album?id=${el.id}" class="msk"></a>
                        <a href="javascript:;" class="icon-play f-alpha f-fr" title="播放"
                        data-res-type="19" data-res-id="132874562" data-res-action="play"></a>
                        </div>
                        <p class="f-thide">
                        <a title="${el.name}" href="/album?id=${el.id}" class="s-fc0 tit">${el.name}</a>
                        </p>
                        <p class="tit f-thide" title="${el.artists[0].name}">
                        <a class="s-fc3" href="/artist?id=12236125">${el.artists[0].name}</a>
                        </p>
                        </li>
                        `)
                }
            });

        }
    })
})